package com.qcxk.yuqian.rtu.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.qcxk.yuqian.rtu.controller.model.page.Pagination;
import com.qcxk.yuqian.rtu.controller.model.query.*;
import com.qcxk.yuqian.rtu.controller.model.response.PageResponse;
import com.qcxk.yuqian.rtu.controller.model.response.Response;
import com.qcxk.yuqian.rtu.entity.RtuOriginalData;
import com.qcxk.yuqian.rtu.service.*;
import com.qcxk.yuqian.system.component.behaviour.BehaviourOperator;
import com.qcxk.yuqian.system.component.constant.SystemConstant;
import com.qcxk.yuqian.system.utils.DataUtils;
import com.qcxk.yuqian.system.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.List;


/**
 * @auther lp
 * @create 2021-11-15 03:23:05
 * @describe 前端控制器
 */
@RestController
@RequestMapping("/alarm")
public class AlarmController {
    @Autowired
    private IDeviceAlarmService deviceAlarmService;

    @RequestMapping(value = "/queryDeviceAlarmList")
    public Response queryDeviceAlarmList(DeviceAlarmDetailDTO dto) {

        PageHelper.startPage(dto.getPage(), dto.getPageSize());
        List<DeviceAlarmDetailDTO> list = deviceAlarmService.findDataList(dto);
        Pagination pagination = Pagination.buildPagination(list, dto);

        return PageResponse.pageResponse(pagination, list).success();
    }
}

